<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="images/icone_site/favicon.jpg">
    <title>Gamekillers - Inscription</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link href="css/complement.css" rel="stylesheet">
  </head>
  <body>
	<?php 
		//include_once("bar_connect.html");
		include_once("accessoires/header.html");
		include_once("accessoires/menu.html");
	?>
	<div class="page">			
		<div class="col-md-6 col-md-offset-3">
			<h3 align="center">Inscription</h3>
			<?php 	if(!isset($success)) { ?>
				<form action="inscription.php" method="post" class="form-horizontal">
					<div class="form-group">
						<label for="inputNom" class="col-sm-2 control-label">Nom</label>
						<div class="col-sm-10">
							<input type="text" name="nom" class="form-control" id="inputNom" placeholder="Nom" value="<?php if(isset($_POST['inscrire'])) echo $lastname_user; ?>">
							<?php 	if(isset($errors[2])) { ?>
								<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
									<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
									<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[2];?>
								</div>
							<?php 	} ?>
						</div>
					</div>
					<div class="form-group">
						<label for="inputPrenom" class="col-sm-2 control-label">Prénom</label>
						<div class="col-sm-10">
							<input type="text" name="prenom" class="form-control" id="inputPrenom" placeholder="Prénom" value="<?php if(isset($_POST['inscrire'])) echo $firstname_user; ?>">
								<?php 	if(isset($errors[3])) { ?>
									<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
										<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
										<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[3];?>
									</div>
								<?php 	} ?>
						</div>
					</div>
					<div class="form-group">
						<label for="inputEmail" class="col-sm-2 control-label">Email</label>
						<div class="col-sm-10">
						  <input type="email" name="email" class="form-control" id="inputEmail" placeholder="Email" value="<?php if(isset($_POST['inscrire'])) echo $email_user; ?>">
								<?php 	if(isset($errors[6])) { ?>
									<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
										<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
										<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[6];?>
									</div>
								<?php 	} ?>
						</div>
					</div>
					<div class="form-group">
						<label for="inputPseudo" class="col-sm-2 control-label">Pseudo</label>
						<div class="col-sm-10">
							<input type="text" name="pseudo" class="form-control" id="inputPseudo" placeholder="Pseudo" value="<?php if(isset($_POST['inscrire'])) echo $pseudo_user; ?>">
								<?php 	if(isset($errors[1])) { ?>
									<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
										<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
										<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[1];?>
									</div>
								<?php } ?>
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword" class="col-sm-2 control-label">Password</label>
						<div class="col-sm-10">
							<input type="password" name="password" class="form-control" id="inputPassword" placeholder="Password">
								<?php 	if(isset($errors[4])) { ?>
									<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
										<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
										<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[4];?>
									</div>
								<?php 	} ?>
							<div class="small">Insérer 8 caractères + 1 lettre Majuscule + 1 nombre au minimum </div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputConfPassword" class="col-sm-2 control-label">Confirmer password</label>
						<div class="col-sm-10">
							<input type="password" name="conf_password" class="form-control" id="inputConfPassword" placeholder="Confirmer Password">
								<?php 	if(isset($errors[5])) { ?>
									<div class="alert alert-danger alert-dismissible" role="alert" style="margin-bottom: 0">
										<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
										<strong><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;</strong><?php echo $errors[5];?>
									</div>
								<?php 	} ?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" name="inscrire" class="btn btn-default">S'inscrire</button>
						</div>
					</div>
				</form>
			<?php 	}else{ ?>
				<div class="alert alert-success" role="alert">
					<strong><span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> </strong>Inscription réussie Redirection dans <span id="compteur"></span>
				</div>
			<?php 	} ?>
		</div>
	</div>
	<?php
		include_once("accessoires/footer.html");
	?>
    <!-- jQuery -->
    <script src="js/jquery-2.1.3.min.js"></script>
    <!-- bootstrap js-->
    <script src="js/bootstrap.min.js"></script>
    <!-- compteur -->
    <script>var temps = 5;</script>
    <script type="text/javascript" src="js/compteur.js"></script>
  </body>
</html>